package org.fluidindia.ria.library.remoting
{
	import flash.utils.Dictionary;
	
	import mx.messaging.ChannelSet;
	import mx.rpc.remoting.RemoteObject;
	
	
	/**
	 * Singleton implementation to load service destinations.
	 * 
	 * To add new destinations:
	 * 
	 * 1. Define a local destination.
	 * <code>
	 *    private var newDestination:RemoteObject;
	 * </code> 
	 * 
	 * 
	 * 2. Add initialization code:
	 * <code>
	 * 	 	private function initializeDestinations():void
	 *		{
	 * 			// Existing code...
	 * 
	 *			newDestination = new RemoteObject();
	 *			newDestination.channelSet = commonModel._channelSet;
	 *			newDestination.destination = "newManager";
	 *		} 
	 * </code>
	 * 
	 * 
	 * 3. Add a getter
	 * <code>
	 *     public function getNewDestination():RemoteObject
	 * 	   {
	 *         return this.newDestination;
	 *     }
	 * </code>
	 */
	public class DestinationLocator
	{
		// Singleton instance of the class
	 	private static var instance:DestinationLocator;

		public var _channelSet:ChannelSet = new ChannelSet();

	 	
		public function createDestination(destination:String):RemoteObject
		{
			var ro:RemoteObject = new RemoteObject();
			ro.channelSet = this._channelSet;
			ro.destination = destination;
			
			return ro;
		}
	}
}

class Private
{
	
}